<template>
    <div class="proxy-center-main-bg">
        <div class="proxy-center-main">
            <img class="backIcon-img" @click="Jumpto('/own')" src="../../assets/img/procenter-back.png" alt="">

            <div :class="['user-template']">
                <div :class="['user-header-template']">
                    <div class="header-img">
                        <img :src="User.head_img==null?'http://www.starrymedia.vip/public/images/icon_goods_thumb_empty_300.png':User.head_img.indexOf('http')>-1?User.head_img:`http://www.starrymedia.vip${User.head_img}`" class="header-img-item" alt="">
                    </div>
                    <img src="../../assets/img/own-header-border.png" class="header-border" alt="">
                </div>
                <div class="user-role">金牌代理</div>
                <div class="user-role-id">ID:{{User.user_code}}</div>
            </div>


            <div class="money-title">
                <div class="money-number">
                    ￥<span>{{User.user_money.split(".")[0]}}</span>.{{User.user_money.split(".")[1]}}
                </div>
            </div>
            <button class="cast-btn" @click="Jumpto('/bankapply')">提现</button>

            <div class="Promote-list">
                <div class="promote-template">
                    <span>{{User.invite_count}}</span>
                    <p>今日推广（人）</p>
                </div>
                <div class="promote-template">
                    <span>{{User.order_count}}</span>
                    <p>今日成交（笔）</p>
                </div>
            </div>

            <div class="Promote-money-list">
                <div class="pm-template">
                    <p style="font-family: 'DINPro Medium';text-align: center;">￥<span>{{User.invite_money.split(".")[0]}}</span>.{{User.invite_money.split(".")[1]}}</p>
                    <p>日推广佣金</p>
                </div>
                <div class="pm-template">
                    <p style="font-family: 'DINPro Medium';text-align: center;">￥<span>{{User.order_money.split(".")[0]}}</span>.{{User.order_money.split(".")[1]}}</p>
                    <p>日成交佣金</p>
                </div>
            </div>


            <!-- 按钮组 -->
            <div class="own-main-btngroup">
                <van-row class="btn-group-template">
                    <van-col span="16">
                        <img class="own-sale" @click="Jumpto('/recomcount')" src="../../assets/img/procenter-count.png" alt="">
                        <img class="own-shoppingcar" @click="Jumpto('/earncount')" src="../../assets/img/procenter-money.png" alt="">
                        <img class="own-coupon" @click="Jumpto('/banklist')" src="../../assets/img/procenter-bankcard.png" alt="">
                    </van-col>
                    <van-col span="8">
                        <img class="own-order" @click="Jumpto('/getcash')" src="../../assets/img/procenter-WithdrawalsRecord.png" alt="">
                    </van-col>
                </van-row>
                <van-row class="btn-group-template2">
                    <van-col span="5">
                        <img class="menuBtn" @click="Jumptoagre" src="../../assets/img/procenter-what.png" alt="">
                    </van-col>
                    <van-col span="19">
                        <img class="earnBtn" @click="Jumpto('/proxycode')" src="../../assets/img/procenter-mycode.png" alt="">
                    </van-col>
                </van-row>
            </div>




        </div>
    </div>
</template>
<script>
import {_agentInfo} from '../../service/proxy'
export default {
    data(){
        return{
            islog:true,
            User:{
                user_money:"0.00"
            },
        }
    },
    async mounted(){
        await this.getData()
    },
    methods:{
        Jumptoagre(){
			this.$router.push({path:"/reg/UserAgreement",query:{id:6}})
		},
        Jumpto(key){
            this.$router.push(key)
        },
        async getData(){
            let _this=this
            let uid=JSON.parse(localStorage.getItem("user")).user_id
            await _agentInfo({
                user_id:uid
            }).then(res=>{
                console.log(res)
                if(res.errcode==1){
                    _this.User=res.data
                }
            })
        }
    }
}
</script>
<style lang="less" scoped>
.font-SC(){
    font-family: "PingFang SC","Microsoft YaHei";
}
.proxy-center-main-bg{
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    &::before{
        background-image: url("../../assets/img/procenter-bg.jpg");
        background-repeat: no-repeat;
        background-position: center;
        background-size: cover;
        background-attachment: fixed;
        content: '';
        display: block;
        position: absolute;
        z-index: -1;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: -20px;
        // filter: blur(10px);
        // transform: scale(1.2);
    }
    .proxy-center-main{
        .backIcon-img{
            width: 9px;
            margin-left: 15px;
            margin-top: 14px;
        }
        .user-template{
            .user-header-template{
                width: 50px;
                height: 50px;
                border-radius: 25px;
                position: relative;
                position: fixed;
                top: 44px;
                left: 15px;
                z-index: 300;
                .header-img{
                    width: 75%;
                    height: 75%;
                    position: absolute;
                    top: 11%;
                    left: 11%;
                    z-index: 999;
                    border-radius: 50%;
                    overflow: hidden;
                    .header-img-item{
                        width: 100%;
                        height: 100%;
                    }
                }
                .header-img-not{
                    width: 80%;
                    height: 80%;
                    position: absolute;
                    top: 10%;
                    left: 10%;
                    z-index: 10;
                    border-radius: 50%;
                    overflow: hidden;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    background-color: #fff;
                    .font-SC();
                    font-size: 12px;
                    color: #000;
                }
                .header-border{
                    width: 100%;
                    height: 100%;
                    position: absolute;
                    top: 0;
                    left: 0;
                    z-index: 15;
                }
            }
            .user-role{
                width: 85px;
                height: 24px;
                position: fixed;
                top: 49px;
                left: 39px;
                z-index: 2;
                background-image: url("../../assets/img/procenter-role.png");
                background-position: center;
                background-size: contain;
                color: #ffffff;
                .font-SC();
                font-size: 12px;
                text-align: right;
                line-height: 24px;
                padding-right: 6px;
                box-shadow: 3px 3px 7px rgba(51, 51, 51, .47);
            }
            .user-role-id{
                position: fixed;
                top: 74px;
                left: 70px;
                font-family: "DINPro-Bold";
                font-size: 12px;
                color: #fff;
            }
        }

        .money-title{
            width: 100%;
            height: 45px;
            position: fixed;
            top: 124px;
            text-align: center;
            .money-number{
                display: inline-block;
                font-family: "DINPro Medium";
                font-size: 18px;
                color: #fff;
                text-align: center;
                span{
                    font-size: 60px;
                }
            }
            
        }
        .cast-btn{
            display: inline-block;
            width:  60px;
            height: 20px;
            background: none;
            outline: none;
            .font-SC();
            font-size: 12px;
            color: #fff;
            line-height: 20px;
            border: 1px solid #fff;
            border-radius: 5px;
            position: fixed;
            top: 175px;
            right: 15px;
            z-index: 999;
        }

        .Promote-list{
            width: 325px;
            height: 66px;
            background-image: url('../../assets/img/Promote-list-bg.png');
            background-position: center;
            background-repeat: no-repeat;
            background-size: contain;
            position: fixed;
            top: 227px;
            left: 25px;
            right: 25px;
            z-index: 500;
            border-radius: 5px;
            box-shadow: 0px 5px 10px #fff;
            display: flex;
            justify-content: space-around;
            align-items: center;
            .promote-template{
                display: inline-block;
                width: 80px;
                height: 66px;
                color: #fff;
                text-align: center;
                padding-top: 8px;
                padding-bottom: 8px;
                span{
                    display: block;
                    font-family: "DINPro Medium";
                    font-size: 18px;
                    line-height: 30px;
                }
                p{
                    .font-SC();
                    font-size: 9px;
                    margin-bottom: 0;
                }
            }
        }

        .Promote-money-list{
            width: 357px;
            height: 80px;
            background-color: rgba(255, 255, 255, .2);
            border-radius: 5px;
            position: fixed;
            top: 277px;
            left:9px;
            right: 9px;
            display: flex;
            justify-content: space-around;
            align-items: center;
            padding-top: 16px;
            .pm-template{
                display: inline-block;
                color: #fff;
                text-align: left;
                p{
                    .font-SC();
                    
                    font-size: 9px;
                    span{
                        font-size: 18px;
                    }
                    margin-bottom: 4px;
                }

            }
        }



        .own-main-btngroup{
            width: 100%;
            height: auto;
            position: fixed;
            top: 313px;
            z-index: 1;
            .btn-group-template{
                margin-top: 42px;
                padding-left: 15px;
                .own-sale{
                    width: 108px;
                }
                .own-shoppingcar{
                    width: 108px;
                    margin: 11px;
                }
                .own-order{
                    width: 108px;
                    margin-top: 11px;
                }
                .own-coupon{
                    width: 227px;
                } 
            }
            .btn-group-template2{
                margin-top: 10px;
                padding-left: 15px;
                .menuBtn{
                    width: 58px;

                }
                .earnBtn{
                    width: 265px; 
                    box-shadow: 3px 3px 7px rgba(51, 51, 51, .47);
                    margin-top: 8px;
                }
            }

        }






        @media only screen and (min-device-height: 600px) and (max-device-height: 675px){
            .money-title{
                width: 100%;
                height: 45px;
                position: fixed;
                top: 70px;
                text-align: center;
                .money-number{
                    display: inline-block;
                    font-family: "DINPro Medium";
                    font-size: 18px;
                    color: #fff;
                    text-align: center;
                    span{
                        font-size: 60px;
                    }
                }
                
            }
            .cast-btn{
                display: inline-block;
                width:  60px;
                height: 20px;
                background: none;
                outline: none;
                .font-SC();
                font-size: 12px;
                color: #fff;
                line-height: 20px;
                border: 1px solid #fff;
                border-radius: 5px;
                position: fixed;
                top: 121px;
                right: 15px;
                z-index: 999;
            }

            .Promote-list{
                width: 325px;
                height: 66px;
                background-image: url('../../assets/img/Promote-list-bg.png');
                background-position: center;
                background-repeat: no-repeat;
                background-size: contain;
                position: fixed;
                top: 153px;
                left: 25px;
                right: 25px;
                z-index: 500;
                border-radius: 5px;
                box-shadow: 0px 5px 10px #fff;
                display: flex;
                justify-content: space-around;
                align-items: center;
                .promote-template{
                    display: inline-block;
                    width: 80px;
                    height: 66px;
                    color: #fff;
                    text-align: center;
                    padding-top: 8px;
                    padding-bottom: 8px;
                    span{
                        display: block;
                        font-family: "DINPro Medium";
                        font-size: 18px;
                        line-height: 30px;
                    }
                    p{
                        .font-SC();
                        font-size: 9px;
                        margin-bottom: 0;
                    }
                }
            }

            .Promote-money-list{
                width: 357px;
                height: 80px;
                background-color: rgba(255, 255, 255, .2);
                border-radius: 5px;
                position: fixed;
                top: 203px;
                left:9px;
                right: 9px;
                display: flex;
                justify-content: space-around;
                align-items: center;
                padding-top: 16px;
                .pm-template{
                    display: inline-block;
                    color: #fff;
                    text-align: left;
                    p{
                        .font-SC();
                        
                        font-size: 9px;
                        span{
                            font-size: 18px;
                        }
                        margin-bottom: 4px;
                    }

                }
            }



            .own-main-btngroup{
                width: 100%;
                height: auto;
                position: fixed;
                top: 239px;
                z-index: 1;
                .btn-group-template{
                    margin-top: 42px;
                    padding-left: 15px;
                    .own-sale{
                        width: 108px;
                    }
                    .own-shoppingcar{
                        width: 108px;
                        margin: 11px;
                    }
                    .own-order{
                        width: 108px;
                        margin-top: 11px;
                    }
                    .own-coupon{
                        width: 227px;
                    } 
                }
                .btn-group-template2{
                    margin-top: 10px;
                    padding-left: 15px;
                    .menuBtn{
                        width: 58px;

                    }
                    .earnBtn{
                        width: 265px; 
                        box-shadow: 3px 3px 7px rgba(51, 51, 51, .47);
                        margin-top: 8px;
                    }
                }

            }
        }



    }
}
</style>